package com.xiaomi.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xiaomi.domain.OrdersEntity;
import com.xiaomi.mappers.OrderMapper;
import com.xiaomi.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class OrderServiceimpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<OrdersEntity> checkOrder() {
        return  orderMapper.checkOrder();
    }

    @Override
    public PageInfo<OrdersEntity> orderPagination(Integer pageNum) {
        PageHelper.startPage(pageNum,10);
        List<OrdersEntity> orders = orderMapper.checkOrder();
        return new PageInfo<>(orders);
    }

    @Override
    public void batchDelOrders(String[] ids) {
        orderMapper.batchDelOrders(ids);
    }
}
